var mongoose = require('mongoose'),
    Schema = mongoose.Schema;
var UserSchema = new Schema({          
    userId : { type: String },                   
    userName: {type: String},                     
    userPwd: {type: Number},                       
    orderList : { type: Array},
    cartList: [
        {
            "productId":String,
            "productName":String,
            "salePrice":Number,
            "productImage":String,
            "checked":String,
            "productNum":Number,
            "checked":Boolean
        }
    ],                       
    addressList: [
        {
            "addressId" : String,
            "userName" :String,
            "streetName" : String,
            "postCode" : {type: String, default: '无'},
            "tel" : String,
            "isDefault" : {type: Number, default: '0'}
        }
    ]                     
});

module.exports = mongoose.model('User',UserSchema);